package org.example.util;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

@Data
@Slf4j
@Component
@RefreshScope
@ConfigurationProperties(prefix = "qq.email")
public class QQMailUtils {

    private String account;
    private String password;

    /**
     *
     * @param to 收件人
     * @return 成功/失败
     */
    public boolean sendMail(String to, String code){
        log.info("{}/{} send message to {}: {}", account, password, to, code);
        return true;
    }

}
